package com.songlanyun.modules.group.controller.api;

import com.songlanyun.common.utils.R;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.group.entity.ProductGoodsGroupEntity;
import com.songlanyun.modules.group.service.ProductGoodsGroupService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;


/**
 * 商家店铺商品分组表（只用来在商家店铺内展示）
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-11-03 12:57:25
 */
@RestController
@RequestMapping("api/goods_group")
public class ProductGoodsGroupApiController extends AbstractApiController {
    @Autowired
    private ProductGoodsGroupService productGoodsGroupService;

    /**
     * 商家店铺商品分组
     */
    @RequestMapping("/all/{shopId}")
    public R all(@PathVariable("shopId") Long shopId){
        List<Map<String, Object>> objs = productGoodsGroupService.getAllGoodsGroup(shopId);
        return R.ok().put("list", objs);
    }




}
